package com.yhh.common.entity.member.view;

import com.yhh.common.entity.member.model.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@ApiModel(value = "UserView",description = "")
public class UserView implements Serializable {

    public UserView() {
    }

    public UserView(User user){
        this.id = user.getId();
        this.status = user.getStatus();
        this.createTime = user.getCreateTime();
        this.modifyTime = user.getModifyTime();
        this.phoneNumber = user.getPhoneNumber();
        this.email = user.getEmail();
        this.openId = user.getOpenId();
        this.password = user.getPassword();
        this.sex = user.getSex();
        this.name = user.getName();
        this.age =user.getAge();
        this.pic = user.getPic();
        this.isVip = user.getIsVip();
        this.score = user.getScore();
    }

    @ApiModelProperty(value = "用户ID")
    private Long id;

    @ApiModelProperty(value = "使用状态(0：禁用 1：正常)")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date modifyTime;

    @ApiModelProperty(value = "电话号码")
    private String phoneNumber;

    @ApiModelProperty(value = "用户邮箱")
    private String email;

    @ApiModelProperty(value = "微信ID")
    private String openId;

    @ApiModelProperty(value = "用户密码")
    private String password;

    @ApiModelProperty(value = "用户性别（0：男 1：女）")
    private Integer sex;

    @ApiModelProperty(value = "用户性别:男/女）")
    private String strSex;

    public String getStrSex() {
        return this.sex == 0 ? "男":"女";
    }

    @ApiModelProperty(value = "用户名称")
    private String name;

    @ApiModelProperty(value = "用户年龄")
    private Integer age;

    @ApiModelProperty(value = "用户头像")
    private String pic;

    @ApiModelProperty(value = "是否是vip(0:普通用户 1：vip)")
    private Integer isVip;

    @ApiModelProperty(value = "用户积分")
    private Integer score;
}
